package org.grow.leave.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: xwg
 * @CreateDate: 2021/10/20
 */

@RestControllerAdvice
public class ExceptionBridge {

    @ExceptionHandler(LeaveException.class)
    public ResponseEntity<String> auth(LeaveException e){
        return new ResponseEntity<>(e.getMessage(),
                null,e.getCode());
    }
}
